{% extends 'base.html' %}
{% block stylesheet %}
{{ block.super }}
{% endblock%}

{% block javascript %}
{{ block.super }}
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
    $('.delete').click(function() {
        var b = confirm("Do you really want to delete it?");
        if (b == false) {
            return false;
        }
    });
});
//]]>
</script>
{% endblock%}


{% block content %}
<h2></h2>

<div id="navi">
    <ul>
        <li><a href="{% url invoice_month_list invoice.year invoice.month %}">{{ invoice.month }}월 Invoice list</a></li>
        <li><a href="{% url invoice_change invoice.id %}">invoice change</a></li>
        <li><a href="{% url invoice_delete invoice.id %}" class="delete">invoice delete</a></li>
        <li><a href="{% url tempinvoice_detail_csv invoice.id %}">invoice download</a></li>
    </ul>
</div>

{% load humanize %}
{% load emc_filters %}
<h3>Invoice detail</h3>
<table class="detail">
    <tr>
        <th>No.</th>
        <th>학교명</th>
        <th>회차</th>
        <th>종류</th>
        <th>Invoiced Date</th>
        <th>Due Date</th>
        <th>Period</th>
        <th>Class Count</th>
        <th>Amount</th>
        <th>Pay Date</th>
        <th>Status</th>
    </tr>
    <tr>
        <td>{{ invoice.no|default_if_none:"-" }}</td>
        <td>{{ invoice.school.name }}_{{ invoice.school.stage }}</td>
        <td>{{ invoice.year}}-{{ invoice.month }}</a></td>
        <td>{{ invoice.type }}</td>
        <td>{{ invoice.invoiced_date }}</td>
        <td>{{ invoice.due_date }}</td>
        <td>{{ invoice.start_date }} ~ {{ invoice.end_date }}</td>
        <td>{{ invoice.count_classes }}</td>
        <td>{{ invoice.total_price|intcomma }}</td>
        <td>{{ invoice.pay_date|default_if_none:"-" }}</td>
        <td>{{ invoice.status }}</td>
    </tr>
    <tr>
        <th colspan=12>Note</th>
    </tr>
    <tr>
        <td colspan=12>{{ invoice.note|default_if_none:"-" }}</td>
    </tr>
</table>


{% endblock %}